import Vue from 'vue'
import Router from 'vue-router'
import login from '../view/login'
import home from '../view/home'
import show from '../view/show'
import index from '../view/index'
import info from '../view/info'
import dept from '../view/dep'
import form from '../view/form'
import formList from '../view/formList'
import transfer from '../view/transfer'
import turn from '../view/turn'
import myTrans from '../view/myTrans'
import myTurn from '../view/myTurn'
import confTurn from "../view/confTurn.vue";
import newTurn from "../view/newTurn.vue";
import formConfig2 from "../view/formConfig2.vue";
import newFile from "../view/newFile.vue";
import echarts from "../view/echarts.vue";
import Welcome from "../view/Welcome.vue";


Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },{
      path:'/home',
      name:'home',
      component:home,
      redirect:'/Welcome',
      children:[
        {
          path:'/Welcome',
          name:'Welcome',
          component:Welcome,
        },
        {
          path:'/echarts',
          name:'echarts',
          component:echarts,
        },
      {
        path:'/show',
        name:'show',
        component:show,
      },
      {
        path:'/newFile',
        name:'newFile',
        component:newFile,
      },
      {
        path:'/index',
        name:'index',
        component:index,
      },
      {
        path:'/info',
        name:'info',
        component:info,
      },
      {
        path:'/dept',
        name:'dept',
        component:dept,
      },
      {
        path:'/form',
        name:'form',
        component:form,
      },
      {
        path:'/formList',
        name:'formList',
        component:formList,
      },
      {
        path:'/transfer',
        name:'transfer',
        component:transfer,
      },
      {
        path:'/turn',
        name:'turn',
        component:turn,
      },
      {
        path:'/confTurn',
        name:'confTurn',
        component:confTurn
      },
      {
        path:'/newTurn',
        name:'newTurn',
        component:newTurn
      },
      {
        path:'/myTrans',
        name:'myTrans',
        component:myTrans,
      },
      {
        path:'/myTurn',
        name:'myTurn',
        component:myTurn,
      },
      {
        path:'/formConfig2',
        name:'formConfig2',
        component:formConfig2,
      },
    ]
    }
  ]
})
